/*
 * @(#)MaintMtmWorkflowProgressUserRecordForm.java
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */
package com.dcivision.workflow.web;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;

import com.dcivision.framework.ApplicationException;
import com.dcivision.framework.TextUtility;
import com.dcivision.framework.bean.AbstractBaseObject;
import com.dcivision.framework.web.AbstractActionForm;
import com.dcivision.workflow.bean.MtmWorkflowProgressUserRecord;

/**
  MaintMtmWorkflowProgressUserRecordForm.java

  This class is the for web form purpose.

  @author      Angus Shiu
  @company     DCIVision Limited
  @creation date   30/12/2003
  @version     $Revision: 1.3 $
*/

public class MaintMtmWorkflowProgressUserRecordForm extends AbstractActionForm {

  public static final String REVISION = "$Revision: 1.3 $";

  private String workflowProgressID = null;
  private String userRecordID = null;
  private String workflowAction = null;
  private String reason = null;

  public MaintMtmWorkflowProgressUserRecordForm() {
    super();
  }

  public String getWorkflowProgressID() { 
    return(this.workflowProgressID);
  }

  public void setWorkflowProgressID(String workflowProgressID) { 
    this.workflowProgressID = workflowProgressID;
  }

  public String getUserRecordID() { 
    return(this.userRecordID);
  }

  public void setUserRecordID(String userRecordID) { 
    this.userRecordID = userRecordID;
  }

  public String getWorkflowAction() { 
    return(this.workflowAction);
  }

  public void setWorkflowAction(String workflowAction) { 
    this.workflowAction = workflowAction;
  }

  public String getReason() { 
    return(this.reason);
  }

  public void setReason(String reason) { 
    this.reason = reason;
  }
  public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
    return super.validate(mapping, request);
  }

  public void reset(ActionMapping mapping, HttpServletRequest request) {
    super.reset(mapping, request);
    this.setID(null);
    this.setWorkflowProgressID(null);
    this.setUserRecordID(null);
    this.setWorkflowAction(null);
    this.setReason(null);
    this.setRecordStatus(null);
    this.setUpdateCount(null);
    this.setCreatorID(null);
    this.setCreateDate(null);
    this.setUpdaterID(null);
    this.setUpdateDate(null);
  }

  public AbstractBaseObject getFormData() throws ApplicationException {
    MtmWorkflowProgressUserRecord tmpMtmWorkflowProgressUserRecord = new MtmWorkflowProgressUserRecord();
    tmpMtmWorkflowProgressUserRecord.setID(TextUtility.parseIntegerObj(this.getID()));
    tmpMtmWorkflowProgressUserRecord.setWorkflowProgressID(TextUtility.parseIntegerObj(this.getWorkflowProgressID()));
    tmpMtmWorkflowProgressUserRecord.setUserRecordID(TextUtility.parseIntegerObj(this.getUserRecordID()));
    tmpMtmWorkflowProgressUserRecord.setWorkflowAction(this.getWorkflowAction());
    tmpMtmWorkflowProgressUserRecord.setReason(this.getReason());
    tmpMtmWorkflowProgressUserRecord.setRecordStatus(this.getRecordStatus());
    tmpMtmWorkflowProgressUserRecord.setUpdateCount(TextUtility.parseIntegerObj(this.getUpdateCount()));
    tmpMtmWorkflowProgressUserRecord.setCreatorID(TextUtility.parseIntegerObj(this.getCreatorID()));
    tmpMtmWorkflowProgressUserRecord.setCreateDate(parseTimestamp(this.getCreateDate()));
    tmpMtmWorkflowProgressUserRecord.setUpdaterID(TextUtility.parseIntegerObj(this.getUpdaterID()));
    tmpMtmWorkflowProgressUserRecord.setUpdateDate(parseTimestamp(this.getUpdateDate()));
    return tmpMtmWorkflowProgressUserRecord;
  }

  public void setFormData(AbstractBaseObject baseObj) throws ApplicationException {
    MtmWorkflowProgressUserRecord tmpMtmWorkflowProgressUserRecord = (MtmWorkflowProgressUserRecord)baseObj;
    this.setID(TextUtility.formatIntegerObj(tmpMtmWorkflowProgressUserRecord.getID()));
    this.setWorkflowProgressID(TextUtility.formatIntegerObj(tmpMtmWorkflowProgressUserRecord.getWorkflowProgressID()));
    this.setUserRecordID(TextUtility.formatIntegerObj(tmpMtmWorkflowProgressUserRecord.getUserRecordID()));
    this.setWorkflowAction(tmpMtmWorkflowProgressUserRecord.getWorkflowAction());
    this.setReason(tmpMtmWorkflowProgressUserRecord.getReason());
    this.setRecordStatus(tmpMtmWorkflowProgressUserRecord.getRecordStatus());
    this.setUpdateCount(TextUtility.formatIntegerObj(tmpMtmWorkflowProgressUserRecord.getUpdateCount()));
    this.setCreatorID(TextUtility.formatIntegerObj(tmpMtmWorkflowProgressUserRecord.getCreatorID()));
    this.setCreateDate(formatTimestamp(tmpMtmWorkflowProgressUserRecord.getCreateDate()));
    this.setUpdaterID(TextUtility.formatIntegerObj(tmpMtmWorkflowProgressUserRecord.getUpdaterID()));
    this.setUpdateDate(formatTimestamp(tmpMtmWorkflowProgressUserRecord.getUpdateDate()));
  }
}
